<template>
	<view class="sbbh">
		<web-view :src="url"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: ""
			};
		},
		onLoad(data) {
			var _that = this;
			uni.login({
				provider: 'weixin',
				success: function(res) {
					uni.request({
						url: 'https://pyzl.51yunmai.com/Account/GetCode?json_code='+res.code,
						success: (res) => {
							let openKey = JSON.parse(res.data.data)
							console.log(openKey,'openKey')
							let openUrl = `https://pyzl.51yunmai.com/Account/LoginP?openid=${openKey.openid}`;
							if (data.url) {
								uni.request({
									url: `https://nmssafety.51yunmai.com/MobileManagementSide/GetWxNoticeUrl?id=${data.url}`,
									success: function(res) {
										openUrl = res.data.data;
										_that.url = openUrl
									}
								})
							} else {
								 _that.url = openUrl
							}
						}
					});
				}
			});
		}
	}
</script>

<style>
</style>
